package com.iris.live.services.services;

import com.iris.live.services.data.models.*;
import com.iris.live.services.models.PageData;
import com.iris.live.services.models.RequestBase;
import com.iris.live.services.models.ResultData;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.data.domain.Page;

import java.io.InputStream;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by sxy on 2016/7/11.
 */
public interface MarketService {

    PageData getActionList(String permit,GetActionListRequest request);

    Object getActionInfoByID(int id);

    boolean saveActionInfoStatus(int id, String status);

    Lsh活动表Model delActionByID(int id);

    List<用户Model> getEmployeeList(String license);

    List<String> getCustomerSource(String source);

    Object saveActionInvite(Object invite);

    String saveLeaflets(Lsh集团消息Model request, Pair<InputStream, String> file);

    String getLeaflets(Lsh集团消息Model request);

    Lsh集团消息Model saveActionContent(Lsh集团消息Model request);

    Lsh集团消息Model updatePolicyFile(Lsh集团消息Model request, Pair<InputStream, String> file);

    List<String> getDealerList();

    Lsh活动表Model saveActionInfo(Lsh活动表Model request);

    List<Lsh活动推送Model> saveActionPush(List<Lsh活动推送Model> modelList);

    List<邀约跟进记录表Model> outputInvite();

    邀约跟进记录表Model saveOutputInvite(邀约跟进记录表Model model);

    List<邀约跟进记录表Model> saveOutputInviteBatch(List<邀约跟进记录表Model> modelList);

    List<Lsh车型Model> getCarType(Lsh车型Model request);

    Page<Lsh导入名单Model> getInputList(String permit, GetInputListRequest request);

    Lsh导入名单Model getInputList(int id,String account);

    Lsh导入名单Model addInputList(Lsh导入名单Model request);

    List<Lsh导入名单Model> addInputListBatch(List<Lsh导入名单Model> modelList);

    List<Lsh市场设置Model> getMarketSetList();
    Lsh市场设置Model getMarketSetList(int MarketID);

    Lsh市场设置Model addMarketSet(Lsh市场设置Model request);

    Lsh活动目标Model saveActionTarget(Lsh活动目标Model request);

    Lsh活动目标Model getActionTarget(int actionID);

    List<Lsh集团消息Model> getActionContentByCarType(int carType);

    Page<Lsh集团消息Model> getActionInfoList(String permit, GetActionInfoList request);

    List getActionPosts(int actionID);

    List getAppointment(String actionID);

    List<Lsh活动推送岗位Model> savePushJobBatch(int id, List<Lsh活动推送岗位Model> modelList);

    List<Lsh活动推送岗位Model> getPushJob(int id);

    顾客记录汇总Model getCustomerLog(int id);

    顾客记录汇总Model saveCustomerLog(顾客记录汇总Model model);

    Lsh导入名单联系表Model getInputRelation(int id,String permit);

    Lsh导入名单联系表Model saveInputRelation(Lsh导入名单联系表Model model);

    预约信息表Model getReservation(int id);

    预约信息表Model saveReservation(预约信息表Model model);

    List getActionTypesList();

    List getActionStarterList();

    List getMarketSetType(String permission, String channel);

    List getMarketSetSource(String permission, String channel, String type);

    List getActionByCar(String permission,  List <String> list );

    PageData getCustomerRecords(String permit,GetCustomerRecords request);

    Map getCustomerRecordsInfo(GetCustomerRecords request);

    Object findInputListByPhone(String phone);

    Lsh导入名单Model getInputList(String phone, String account, String permit);

    int getTaskCompleteCount(String permission, String customer);

    List getSaleListByCustomer(int customerID);

    List getPassengerFlowLogByCustomer(int customerID);

    List getActionIDList(int id);

    Object getOrderStatus(int customer);

    List getOrderStatusList(int customer);

    Map getCustomerIDFromRecords(String customer, String sale);

    List getCompetingList();


    boolean saveStatusByCustomerId(int customerId, String status);

    List getCompetingListByBrand(String brand);

    PageData getGetActKPIList(GetGetActKPIListReq req);

    boolean updateActKPIStatus(GetGetActKPIListReq req);

    Map saveActKPIList(List<Lsh活动KpiModel> reqList);

    boolean isExsitActKPI(GetGetActKPIListReq req);

    PageData getActRecommendKPIList(GetGetActKPIListReq req);

    boolean updateActivityStatus(GetGetActKPIListReq req);

    boolean saveActTargetKPIList(List<Lsh活动目标Model> reqList);

    boolean saveActRecommendKPI(List<GetGetActKPIListReq> reqList);

    List getActAttachKPIList(GetGetActKPIListReq req);

    Map getActKPI(GetActKPIReq req);

    ResultData getSignForm(GetActKPIReq req);

    ResultData saveClueDistributionSetUp (String permit, String username, String value) throws Exception;

    ResultData getClueDistributionSetUp (String permit, String username) throws Exception;

    void scClainClue (String permit, String username, String phone) throws Exception;

    void dccDistributionOverTimeHandling() throws Exception;


    static class GetActKPIReq {
        public String permit;
        public String actCode;
        public String actStartDate;
        public String actEndDate;
    }

    static class GetGetActKPIListReq extends RequestBase {
        public String permit;
        public String 许可;
        public Integer KPI编号;
        public String 启用状态;
        public String KPI;
        public Integer 活动类型编号;
        public String 选择状态;
        public String 备注;
        public String 更新账号;
        public Integer 活动编号;

    }

    static class GetActionListRequest extends RequestBase {

        public String code;
        public String name;
        public String level;
        public String type;
        public Date startBefore;
        public Date endAfter;
        public String actionCode;
        public String starter;
    }

    static class GetInputListRequest extends RequestBase {

        public String name;
        public String phone;
        public String type;
        public Date startBefore;
        public Date endAfter;

        public String series;
        public String model;

        public Integer id;
        public String account;
    }

    static class GetActionInfoList extends RequestBase {

        public String name;
        public String department;
        public String type;
        public Date startBefore;
        public Date endAfter;
    }

    static class GetCustomerRecords extends RequestBase{
        public String belongCDO;
        public String phone;
        public String name;
        public String sex;
        public String channel;
        public String type;
        public String source;
        public String car;
        public String level;
        public String status;
        public String marketActiveName;

    }

}
